package com.ruoyi.project.jiaqin.membernewslikes.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.membernewslikes.mapper.MemberNewsLikesMapper;
import com.ruoyi.project.jiaqin.membernewslikes.domain.MemberNewsLikes;
import com.ruoyi.project.jiaqin.membernewslikes.service.IMemberNewsLikesService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 用户点赞新闻Service业务层处理
 *
 * @author admin
 * @date 2021-01-21
 */
@Service
public class MemberNewsLikesServiceImpl implements IMemberNewsLikesService
{
    @Autowired
    private MemberNewsLikesMapper memberNewsLikesMapper;

    /**
     * 查询用户点赞新闻
     *
     * @param memberId 用户点赞新闻ID
     * @return 用户点赞新闻
     */
    @Override
    public MemberNewsLikes selectMemberNewsLikesById(String memberId,String newsId)
    {
        return memberNewsLikesMapper.selectMemberNewsLikesById(memberId,newsId);
    }

    /**
     * 查询用户点赞新闻列表
     *
     * @param memberNewsLikes 用户点赞新闻
     * @return 用户点赞新闻
     */
    @Override
    public List<MemberNewsLikes> selectMemberNewsLikesList(MemberNewsLikes memberNewsLikes)
    {
        return memberNewsLikesMapper.selectMemberNewsLikesList(memberNewsLikes);
    }

    /**
     * 新增用户点赞新闻
     *
     * @param memberNewsLikes 用户点赞新闻
     * @return 结果
     */
    @Override
    public int insertMemberNewsLikes(MemberNewsLikes memberNewsLikes)
    {
        return memberNewsLikesMapper.insertMemberNewsLikes(memberNewsLikes);
    }

    /**
     * 修改用户点赞新闻
     *
     * @param memberNewsLikes 用户点赞新闻
     * @return 结果
     */
    @Override
    public int updateMemberNewsLikes(MemberNewsLikes memberNewsLikes)
    {
        return memberNewsLikesMapper.updateMemberNewsLikes(memberNewsLikes);
    }

    /**
     * 删除用户点赞新闻对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMemberNewsLikesByIds(String ids)
    {
        return memberNewsLikesMapper.deleteMemberNewsLikesByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户点赞新闻信息
     *
     * @param memberId 用户点赞新闻ID
     * @return 结果
     */
    @Override
    public int deleteMemberNewsLikesById(String memberId,String newsId)
    {
        return memberNewsLikesMapper.deleteMemberNewsLikesById(memberId,newsId);
    }
}
